.content {
  display: flex;
  block-size: 10rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.upload-container {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  position: relative;

  &.disabled {
    opacity: 0.7;
    cursor: not-allowed;

    .upload-area,
    .preview-container {
      pointer-events: none;
    }

    // 允许查看预览
    .preview-button.view-button {
      pointer-events: auto;
    }
  }
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d9e1ef;
  border-radius: 4px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #f9fbff;
  min-height: 200px;
  position: relative;
  overflow: hidden;

  &:hover {
    border-color: #5b8af5;
    background-color: #f0f5ff;
  }

  &.upload-error {
    border-color: #f44336;
    background-color: #fff8f8;
  }

  input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;

    &:disabled {
      cursor: not-allowed;
    }
  }
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #5a6685;

  svg {
    color: #5b8af5;
    margin-bottom: 12px;
  }
}

.upload-text {
  p {
    margin: 5px 0;

    &:first-child {
      font-size: 16px;
      font-weight: 500;
      color: #333;
    }
  }

  .upload-hint {
    font-size: 12px;
    color: #8898aa;
  }
}

/* 验证错误提示样式 */
.validation-error {
  display: flex;
  align-items: flex-start;
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #ffebee;
  border-radius: 4px;
  color: #d32f2f;
  animation: fadeIn 0.3s ease-in-out;

  .error-icon {
    margin-right: 8px;
    line-height: 1;
    display: flex;

    svg {
      color: #d32f2f;
    }
  }

  .error-message {
    line-height: 1.4;
  }
}

.preview-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  position: relative;

  .image-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f1f1f1;
    min-height: 200px;

    img {
      max-width: 100%;
      max-height: 300px;
      cursor: pointer;
    }
  }

  .preview-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
  }
}

.preview-button {
  display: flex;
  align-items: center;
  gap: 5px;
  border: none;
  background-color: transparent;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;

  &.view-button {
    color: #5b8af5;

    &:hover {
      background-color: #ecf1ff;
    }

    svg {
      color: #5b8af5;
    }
  }

  &.delete-button {
    color: #f44336;

    &:hover {
      background-color: #ffeeee;
    }

    svg {
      color: #f44336;
    }
  }

  &.upload-button {
    color: #4caf50;

    &:hover {
      background-color: #e6f7e9;
    }

    svg {
      color: #4caf50;
    }
  }
}

.loading-overlay {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 2;

  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(91, 138, 245, 0.2);
    border-radius: 50%;
    border-top-color: #5b8af5;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
  }

  p {
    color: #5b8af5;
    font-weight: 500;
  }
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
